﻿<%@ Page Language="C#" MasterPageFile="~/User.Master" AutoEventWireup="true" CodeBehind="User_DanhSachHoaDon.aspx.cs" Inherits="ppm_BaByShop.WebForm13" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        Trang danh sách hóa đơn.</p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ppm_BaByShopConnectionString1 %>" 
            DeleteCommand="DELETE FROM [CHI_TIET_HOA_DON] WHERE [ma_hoa_don] = @original_ma_hoa_don AND [ma_sp] = @original_ma_sp AND [gia_ban] = @original_gia_ban AND [sl_mua] = @original_sl_mua AND [thanh_tien] = @original_thanh_tien" 
            InsertCommand="INSERT INTO [CHI_TIET_HOA_DON] ([ma_hoa_don], [ma_sp], [gia_ban], [sl_mua], [thanh_tien]) VALUES (@ma_hoa_don, @ma_sp, @gia_ban, @sl_mua, @thanh_tien)" 
            SelectCommand="SELECT * FROM [CHI_TIET_HOA_DON]" 
            
            UpdateCommand="UPDATE [CHI_TIET_HOA_DON] SET [gia_ban] = @gia_ban, [sl_mua] = @sl_mua, [thanh_tien] = @thanh_tien WHERE [ma_hoa_don] = @original_ma_hoa_don AND [ma_sp] = @original_ma_sp AND [gia_ban] = @original_gia_ban AND [sl_mua] = @original_sl_mua AND [thanh_tien] = @original_thanh_tien" 
            ConflictDetection="CompareAllValues" 
            OldValuesParameterFormatString="original_{0}">
            <DeleteParameters>
                <asp:Parameter Name="original_ma_hoa_don" Type="String" />
                <asp:Parameter Name="original_ma_sp" Type="String" />
                <asp:Parameter Name="original_gia_ban" Type="Int32" />
                <asp:Parameter Name="original_sl_mua" Type="Int32" />
                <asp:Parameter Name="original_thanh_tien" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="gia_ban" Type="Int32" />
                <asp:Parameter Name="sl_mua" Type="Int32" />
                <asp:Parameter Name="thanh_tien" Type="Int32" />
                <asp:Parameter Name="original_ma_hoa_don" Type="String" />
                <asp:Parameter Name="original_ma_sp" Type="String" />
                <asp:Parameter Name="original_gia_ban" Type="Int32" />
                <asp:Parameter Name="original_sl_mua" Type="Int32" />
                <asp:Parameter Name="original_thanh_tien" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ma_hoa_don" Type="String" />
                <asp:Parameter Name="ma_sp" Type="String" />
                <asp:Parameter Name="gia_ban" Type="Int32" />
                <asp:Parameter Name="sl_mua" Type="Int32" />
                <asp:Parameter Name="thanh_tien" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
            AutoGenerateRows="False" DataKeyNames="ma_hoa_don,ma_sp" 
            DataSourceID="SqlDataSource2" Height="50px" Width="125px">
            <Fields>
                <asp:BoundField DataField="ma_hoa_don" HeaderText="ma_hoa_don" ReadOnly="True" 
                    SortExpression="ma_hoa_don" />
                <asp:BoundField DataField="ma_sp" HeaderText="ma_sp" SortExpression="ma_sp" 
                    ReadOnly="True" />
                <asp:BoundField DataField="gia_ban" HeaderText="gia_ban" 
                    SortExpression="gia_ban" />
                <asp:BoundField DataField="sl_mua" HeaderText="sl_mua" 
                    SortExpression="sl_mua" />
                <asp:BoundField DataField="thanh_tien" HeaderText="thanh_tien" 
                    SortExpression="thanh_tien" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True" ShowSelectButton="True" />
            </Fields>
        </asp:DetailsView>
    </p>
</asp:Content>
